package com.hfuu.demo.controller;

import com.hfuu.demo.domain.entity.User;
import com.hfuu.demo.domain.vo.ResponseResult;
import com.hfuu.demo.service.LoginService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @description:
 * @author: gunala
 * @date: 2024/2/4 15:29
 */
@RestController
@RequiredArgsConstructor
public class LoginController {

    private final LoginService loginService;
    @PostMapping("/user/login")
    public ResponseResult login(@RequestBody User user){
        Map<String, Object> map = loginService.login(user);
        return new ResponseResult(200,"登录成功",map);
    }
}
